<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>旋转太极</title>
  </head>
  <style>
    .circle {
      width: 100px;
      height: 100px;
      border-radius: 100%;
      margin: 300px auto;
      box-shadow: 0 0 10px 0px #1d1c1c;
      overflow: hidden;
      position: relative;
      animation: circle 1s;
      animation-name: circle;
      animation-duration: 0.01ms;
      animation-iteration-count: infinite;
      animation-timing-function: linear;
    }
    .black {
      width: 52px;
      height: 100px;
      background-color: #000;
      position: absolute;
      right: 0;
      z-index: 10;
    }
    .white-circle {
      width: 50px;
      height: 50px;
      border-radius: 100%;
      background-color: #fff;
      position: absolute;
      margin: auto;
      left: 0;
      right: 0;
      z-index: 11;
    }
    .little-white-circle {
      width: 14px;
      height: 14px;
      border-radius: 100%;
      background-color: #fff;
      position: absolute;
      margin: auto;
      left: 0;
      right: 0;
      bottom: 20px;
      z-index: 12;
    }
    .black-circle {
      width: 50px;
      height: 50px;
      border-radius: 100%;
      background-color: #000;
      position: absolute;
      margin: auto;
      left: 0;
      right: 0;
      top: 50px;
      z-index: 11;
    }
    .little-black-circle {
      width: 14px;
      height: 14px;
      border-radius: 100%;
      background-color: #000;
      position: absolute;
      margin: auto;
      left: 0;
      right: 0;
      top: 20px;
      z-index: 12;
    }
    .second {
      text-align: center;
      font-size: 48px;
      font-weight: bold;
      margin-top: 20px;
    }

    @keyframes circle {
      0% {
        transform: rotate(0deg) scale(4);
      }
      50% {
        transform: rotate(180deg) scale(4);
      }
      100% {
        transform: rotate(360deg) scale(4);
      }
    }
  </style>
  <body>
    <div>
      转速：<input type="number" class="number-input" value="1000" step="20" />
    </div>
    <div class="circle">
      <div class="black"></div>
      <div class="white-circle"></div>
      <div class="black-circle"></div>
      <div class="little-white-circle"></div>
      <div class="little-black-circle"></div>
    </div>
  </body>
</html>

<script>
  const numberEle = document.querySelector(".number-input");
  const circleEle = document.querySelector(".circle");

  numberEle.addEventListener("change", (e) => {
    console.log(e.target.value);
    circleEle.style.animationDuration = e.target.value + "ms";
  });
</script>
